﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbOle2Frame : OdDbOleFrame
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbOle2Frame(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbOle2Frame_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbOle2Frame obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbOle2Frame()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbOle2Frame(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbOle2Frame cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbOle2Frame_cast(OdRxObject.getCPtr(pObj));
			OdDbOle2Frame result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbOle2Frame)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbOle2Frame)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbOle2Frame)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbOle2Frame_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbOle2Frame_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbOle2Frame_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdDbOle2Frame createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbOle2Frame_createObject();
			OdDbOle2Frame result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbOle2Frame)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbOle2Frame)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbOle2Frame)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult dwgInFields(OdDbDwgFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbOle2Frame_dwgInFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dwgOutFields(OdDbDwgFiler pFiler)
		{
			TD_DbPINVOKE.OdDbOle2Frame_dwgOutFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dxfInFields(OdDbDxfFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbOle2Frame_dxfInFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dxfOutFields(OdDbDxfFiler pFiler)
		{
			TD_DbPINVOKE.OdDbOle2Frame_dxfOutFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual bool subWorldDraw(OdGiWorldDraw pWd)
		{
			bool result = TD_DbPINVOKE.OdDbOle2Frame_subWorldDraw(this.swigCPtr, OdGiWorldDraw.getCPtr(pWd));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void subViewportDraw(OdGiViewportDraw pVd)
		{
			TD_DbPINVOKE.OdDbOle2Frame_subViewportDraw(this.swigCPtr, OdGiViewportDraw.getCPtr(pVd));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult subTransformBy(OdGeMatrix3d xfm)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbOle2Frame_subTransformBy(this.swigCPtr, OdGeMatrix3d.getCPtr(xfm));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getLocation(OdGePoint3d point3d)
		{
			TD_DbPINVOKE.OdDbOle2Frame_getLocation(this.swigCPtr, OdGePoint3d.getCPtr(point3d));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void position(OdRectangle3d rect3d)
		{
			TD_DbPINVOKE.OdDbOle2Frame_position(this.swigCPtr, OdRectangle3d.getCPtr(rect3d));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setPosition(OdRectangle3d rect3d)
		{
			TD_DbPINVOKE.OdDbOle2Frame_setPosition(this.swigCPtr, OdRectangle3d.getCPtr(rect3d));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public string getUserType()
		{
			string result = TD_DbPINVOKE.OdDbOle2Frame_getUserType(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbOle2Frame.Type getType()
		{
			OdDbOle2Frame.Type result = (OdDbOle2Frame.Type)TD_DbPINVOKE.OdDbOle2Frame_getType(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public string getLinkName()
		{
			string result = TD_DbPINVOKE.OdDbOle2Frame_getLinkName(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public string getLinkPath()
		{
			string result = TD_DbPINVOKE.OdDbOle2Frame_getLinkPath(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbOle2Frame.PlotQuality outputQuality()
		{
			OdDbOle2Frame.PlotQuality result = (OdDbOle2Frame.PlotQuality)TD_DbPINVOKE.OdDbOle2Frame_outputQuality(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setOutputQuality(OdDbOle2Frame.PlotQuality quality)
		{
			TD_DbPINVOKE.OdDbOle2Frame_setOutputQuality(this.swigCPtr, (int)quality);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public uint getCompoundDocumentDataSize()
		{
			uint result = TD_DbPINVOKE.OdDbOle2Frame_getCompoundDocumentDataSize(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getCompoundDocument(OdStreamBuf streamBuf)
		{
			TD_DbPINVOKE.OdDbOle2Frame_getCompoundDocument(this.swigCPtr, OdStreamBuf.getCPtr(streamBuf));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setCompoundDocument(uint nSize, OdStreamBuf streamBuf)
		{
			TD_DbPINVOKE.OdDbOle2Frame_setCompoundDocument(this.swigCPtr, nSize, OdStreamBuf.getCPtr(streamBuf));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult subGetClassID(IntPtr pClsid)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbOle2Frame_subGetClassID(this.swigCPtr, pClsid);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdOleItemHandler itemHandler()
		{
			OdOleItemHandler result = (OdOleItemHandler)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbOle2Frame_itemHandler(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdOleItemHandler getItemHandler()
		{
			OdOleItemHandler result = (OdOleItemHandler)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbOle2Frame_getItemHandler(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void subClose()
		{
			TD_DbPINVOKE.OdDbOle2Frame_subClose(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public int unhandled_unknown0()
		{
			int result = TD_DbPINVOKE.OdDbOle2Frame_unhandled_unknown0(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public byte unhandled_unknown1()
		{
			byte result = TD_DbPINVOKE.OdDbOle2Frame_unhandled_unknown1(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public byte unhandled_unknown2()
		{
			byte result = TD_DbPINVOKE.OdDbOle2Frame_unhandled_unknown2(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void unhandled_setUnknown(int unk0, byte unk1, byte unk2)
		{
			TD_DbPINVOKE.OdDbOle2Frame_unhandled_setUnknown__SWIG_0(this.swigCPtr, unk0, unk1, unk2);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void unhandled_setUnknown(int unk0, byte unk1)
		{
			TD_DbPINVOKE.OdDbOle2Frame_unhandled_setUnknown__SWIG_1(this.swigCPtr, unk0, unk1);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void unhandled_setUnknown(int unk0)
		{
			TD_DbPINVOKE.OdDbOle2Frame_unhandled_setUnknown__SWIG_2(this.swigCPtr, unk0);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void unhandled_setUnknown()
		{
			TD_DbPINVOKE.OdDbOle2Frame_unhandled_setUnknown__SWIG_3(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public ushort unhandled_himetricWidth()
		{
			ushort result = TD_DbPINVOKE.OdDbOle2Frame_unhandled_himetricWidth(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public ushort unhandled_himetricHeight()
		{
			ushort result = TD_DbPINVOKE.OdDbOle2Frame_unhandled_himetricHeight(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void unhandled_setHimetricSize(ushort w, ushort h)
		{
			TD_DbPINVOKE.OdDbOle2Frame_unhandled_setHimetricSize(this.swigCPtr, w, h);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void reset(bool bInitSize)
		{
			TD_DbPINVOKE.OdDbOle2Frame_reset__SWIG_0(this.swigCPtr, bInitSize);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void reset()
		{
			TD_DbPINVOKE.OdDbOle2Frame_reset__SWIG_1(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool autoOutputQuality()
		{
			bool result = TD_DbPINVOKE.OdDbOle2Frame_autoOutputQuality(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setAutoOutputQuality(bool bFlag)
		{
			TD_DbPINVOKE.OdDbOle2Frame_setAutoOutputQuality(this.swigCPtr, bFlag);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double rotation()
		{
			double result = TD_DbPINVOKE.OdDbOle2Frame_rotation(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setRotation(double fAngle)
		{
			TD_DbPINVOKE.OdDbOle2Frame_setRotation(this.swigCPtr, fAngle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double wcsWidth()
		{
			double result = TD_DbPINVOKE.OdDbOle2Frame_wcsWidth(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setWcsWidth(double fWidth)
		{
			TD_DbPINVOKE.OdDbOle2Frame_setWcsWidth(this.swigCPtr, fWidth);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double wcsHeight()
		{
			double result = TD_DbPINVOKE.OdDbOle2Frame_wcsHeight(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setWcsHeight(double fHeight)
		{
			TD_DbPINVOKE.OdDbOle2Frame_setWcsHeight(this.swigCPtr, fHeight);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double scaleWidth()
		{
			double result = TD_DbPINVOKE.OdDbOle2Frame_scaleWidth(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setScaleWidth(double fScale)
		{
			TD_DbPINVOKE.OdDbOle2Frame_setScaleWidth(this.swigCPtr, fScale);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double scaleHeight()
		{
			double result = TD_DbPINVOKE.OdDbOle2Frame_scaleHeight(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setScaleHeight(double fScale)
		{
			TD_DbPINVOKE.OdDbOle2Frame_setScaleHeight(this.swigCPtr, fScale);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool lockAspect()
		{
			bool result = TD_DbPINVOKE.OdDbOle2Frame_lockAspect(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setLockAspect(bool bLockAspect)
		{
			TD_DbPINVOKE.OdDbOle2Frame_setLockAspect(this.swigCPtr, bLockAspect);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public SWIGTYPE_p_COleClientItem getOleClientItem()
		{
			IntPtr intPtr = TD_DbPINVOKE.OdDbOle2Frame_getOleClientItem(this.swigCPtr);
			SWIGTYPE_p_COleClientItem result = (intPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_COleClientItem(intPtr, false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetTransformedCopy(OdGeMatrix3d mat, out OdDbEntity pCopy)
		{
			IntPtr zero = IntPtr.Zero;
			OdResult result;
			try
			{
				OdResult odResult = (OdResult)TD_DbPINVOKE.OdDbOle2Frame_subGetTransformedCopy(this.swigCPtr, OdGeMatrix3d.getCPtr(mat), out zero);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = odResult;
			}
			finally
			{
				pCopy = (OdDbEntity)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
			return result;
		}

		public new virtual void subSetDatabaseDefaults(OdDbDatabase pDb, bool arg1)
		{
			TD_DbPINVOKE.OdDbOle2Frame_subSetDatabaseDefaults(this.swigCPtr, OdDbDatabase.getCPtr(pDb), arg1);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		public enum Type
		{
			kUnknown,
			kLink,
			kEmbedded,
			kStatic
		}

		public enum PlotQuality
		{
			kMonochrome,
			kLowGraphics,
			kHighGraphics,
			kAutomatic
		}
	}
}
